
import { createAPI } from "@/utils/request";

// 文章列表
export const list = data => createAPI("/articles", "get", data);

// 文章简单列表
export const simple = data => createAPI("/articles/simple", "post", data);

// 文章详情
export const detail = data =>
  createAPI(`/articles/${data.id}`, "get", data);

// 文章添加
export const add = data => createAPI("/articles", "post", data);

// 文章修改
export const update = data => createAPI(`/articles/${data.id}`, "put", data);

// 文章删除
export const remove = data =>
  createAPI(`/articles/${data.id}`, "delete");

// 文章状态
export const changeState = data => createAPI(`/articles/${data.id}/${data.state}`, "post");